
include $(PROJECT_ROOT)/autoconfig.mk

obj-$(CONFIG_DM)        	+= qe_arch.o
obj-$(CONFIG_DM)        	+= qe_device.o
obj-$(CONFIG_SPI)       	+= qe_spi_core.o
obj-$(CONFIG_SPI)       	+= qe_spi_dev.o
obj-$(CONFIG_SPI_FLASH)   	+= qe_spi_flash.o
obj-$(CONFIG_SERIAL)       	+= qe_serial.o
obj-$(CONFIG_IIC)        	+= qe_i2c.o

inc-$(CONFIG_DM)            += $(INCLUDE_DIR)/device/qe_arch.h
inc-$(CONFIG_DM)            += $(INCLUDE_DIR)/device/qe_device.h
inc-$(CONFIG_SPI)           += $(INCLUDE_DIR)/device/qe_spi.h
inc-$(CONFIG_SPI_FLASH)     += $(INCLUDE_DIR)/device/qe_spi_flash.h
inc-$(CONFIG_SERIAL)        += $(INCLUDE_DIR)/device/qe_serial.h
inc-$(CONFIG_IIC)           += $(INCLUDE_DIR)/device/qe_i2c.h

INCLUDES := -I$(INCLUDE_DIR) \
			-I$(INCLUDE_DIR)/generated \
			-I$(INCLUDE_DIR)/device

all: $(obj-y)
$(obj-y):
%.o : %.c
	$(CC) $(CFLAGS) $(ARCH_CPPFLAGS) $(INCLUDES) -c $< -o $(BUILD_OJB_DIR)/$@

.PHONY: install
install:
	cp $(inc-y) $(INSTALL_INC_DIR)